package com.xindz.hgq.database.greendao.bean;

import org.greenrobot.greendao.DaoException;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Property;

import java.io.Serializable;


/**
 * @name HGQBase
 * @class name：com.xindz.hgq.database.greendao.bean
 * @describe 中间关系表 存储教师与学生的关系
 * @anthor XINDZ
 * @time 2018/5/21 16:51
 * @change
 * @chang time
 * @class describe
 */
@Entity(active = true, nameInDb = "JoinStudentToTeacher")
public class JoinStudentToTeacher implements Serializable {
    private static final long serialVersionUID = -1334437203699546888L;
    @Id(autoincrement = true)
    private Long id;
    /**
     * 关联学生的ID
     */
    @Property(nameInDb = "studentId")
    private String studentId;
    /**
     * 关联教师的ID
     */
    @Property(nameInDb = "teacherId")
    private String teacherId;
    /**
     * Used to resolve relations
     */
    @Generated(hash = 2040040024)
    private transient DaoSession daoSession;
    /**
     * Used for active entity operations.
     */
    @Generated(hash = 1098194254)
    private transient JoinStudentToTeacherDao myDao;

    @Generated(hash = 566544298)
    public JoinStudentToTeacher(Long id, String studentId, String teacherId) {
        this.id = id;
        this.studentId = studentId;
        this.teacherId = teacherId;
    }

    @Generated(hash = 442743762)
    public JoinStudentToTeacher() {
    }

    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getStudentId() {
        return this.studentId;
    }

    public void setStudentId(String studentId) {
        this.studentId = studentId;
    }

    public String getTeacherId() {
        return this.teacherId;
    }

    public void setTeacherId(String teacherId) {
        this.teacherId = teacherId;
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 128553479)
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 1942392019)
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 713229351)
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }

    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 135673591)
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getJoinStudentToTeacherDao() : null;
    }
}
